package com.kingyea.mobilepolice.config.feign;

import feign.RequestInterceptor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;

/**
 * Created by beaver on 2017/6/3.
 */
@Configuration
public class OAuth2FeignAutoConfiguration {


    @Bean
    public RequestInterceptor oauth2FeignRequestInterceptor(@Qualifier("practiceOAuth2RestTemplate") OAuth2RestTemplate oAuth2RestTemplate) {
        return new OAuth2FeignRequestInterceptor4SysClient(oAuth2RestTemplate);
    }

}
